package com.zlc.platform.controller;

import com.github.pagehelper.PageHelper;
import com.zlc.common.common.entity.PageVo;
import com.zlc.common.core.sys.model.vo.MayanSysLogVo;
import com.zlc.common.model.sys.LoginLogRequest;
import com.zlc.common.model.sys.OperateLogRequest;
import com.zlc.platform.service.SysLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@Api(tags = "系统日志")
@RestController
@RequestMapping("/api/syslog")
public class SysLogController {

    @Autowired
    private SysLogService sysLogService;


    @ApiOperation(value = "登录日志查询")
    @PostMapping(value = "/findLoginLog")
    public PageVo<MayanSysLogVo> findLoginLog(@RequestBody LoginLogRequest request) {
        return sysLogService.findLoginLog(request);
    }

    @ApiOperation(value = "操作日志查询")
    @PostMapping(value = "/findOperateLog")
    public PageVo<MayanSysLogVo> findOperateLog(@RequestBody OperateLogRequest request) {
        return sysLogService.findOperateLog(request);
    }
}
